-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC: Fix aliases in WHERE
clause
#115
Conversation
Signed-off-by: Yury-Fridlyand <yuryf@bitquilltech.com>
AnalysisContext
to resolve identifiers later.WHERE
clause
This comment was marked as spam.
This comment was marked as spam.
WHERE
clauseWHERE
clause
https://stackoverflow.com/a/942592
Copied from MySQL documentation |
Nice find! We can close the issue then. I checked and SQL Server and Oracle have the same restriction. The way around it is to use a subquery: SELECT Id, fieldSum FROM (SELECT Id, fieldA + fieldB AS fieldSum FROM numberTable) where fieldSum > 40 |
TODOs so far:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this expected outcome?
opensearchsql> select int0 i0, int1 i1, int2 i2 from calcs where i1 > 0;
{'reason': 'Invalid SQL query', 'details': "can't resolve Symbol(namespace=FIELD_NAME, name=i1) in type env", 'type': 'SemanticCheckException'}
Good point. The error message should be user friendly. |
Well, all these work. There are few bugs posted in SQL repo. |
Signed-off-by: Yury-Fridlyand yuryf@bitquilltech.com
Description
Test data
BEFORE
Exception
AFTER
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.